package com.dhee.creditcardsystem.service.Impl;

import com.dhee.creditcardsystem.dao.AppDao;

import com.dhee.creditcardsystem.model.App;
import com.dhee.creditcardsystem.service.AppService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.SQLException;

@Service
public class AppServiceImpl implements AppService {


    @Autowired
    private AppDao appDao;

    @Override
    public boolean addApp(App app) {
        if (app != null) {
            int result = appDao.insert(app);
            if (result > 0) return true;
        }
        return false;
    }


    @Override
    public App selectByCstId(String cstid) {

        App app = appDao.selectByCstId(cstid);

        return app;
    }

    @Override
    public boolean updateApp(App app) {
        if (app != null) {

            int result = appDao.update(app);
            if (result > 0) return true;
        }
        return false;
    }
}
